
package com.dustedpixels.jasmin.unit.compiler;

public class Arguments {
  public String[] argTypes;
  public String[] argNames;
  
  public Arguments(String... argTypesAndNames) {
    argTypes = new String[argTypesAndNames.length / 2];
    argNames = new String[argTypesAndNames.length / 2];
    
    for (int i = 0; i < argTypes.length; i++) {
      argTypes[i] = argTypesAndNames[i*2];
      argNames[i] = argTypesAndNames[i*2 + 1];
    }
  }
  
  public String toString() {
    StringBuffer buffer = new StringBuffer();
    for (int i = 0; i < argTypes.length; i++) {
      if (i != 0) buffer.append(", ");
      buffer.append(argTypes[i] + " " + argNames[i]);
    }
    return buffer.toString();
  }
}
